<%@page contentType="text/html; charset=UTF-8" %>
<jsp:useBean id="user" class="entity_beans.User" scope="session"></jsp:useBean>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Air Transport - Add New City</title>
</head>
<body>
<%! boolean addFlag = false; %>
<%
	if (user.isAccessed() == false) {
		response.sendRedirect("../index.jsp");
		return;
	}

	if ( user.isLoggedIn() == false ) {
		response.sendRedirect("../index.jsp");
		return;
	}
	
	String name = request.getParameter("cityname");
	addFlag = Boolean.parseBoolean(request.getParameter("flag"));
%>



<h2><u>Air Transport Service - Add New City</u></h2>

<jsp:include page="header.jsp"></jsp:include>


<form name="forma" method="post" action="../AddNewCityServlet">

<table BORDER="2" cellspacing="2">

<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">City ID:</td>
<td align="center">
<input id="cityID" name="cityID" size="20"  TYPE="TEXT" style="float:left"></td>
</tr>
<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">City Name:</td>
<td align="center">
<input id="cityName" name="cityName" size="20"  TYPE="TEXT" style="float:left"></td>
</tr>

<tr align="center">
<td bgcolor="#CCCCCC">&nbsp;</td>
<td bgcolor="#CCCC99">
  <INPUT TYPE="submit" NAME="submit" VALUE="Add"></td>
</tr>
</table>

</form>

<hr width="30%" align="left">
<%
if (name != null) {
	if (addFlag == true) {
%>
		The city <font color="red"><i><b><%= name %></b></i></font> is added.
<%
	} else {
%>
		The city <font color="red"><i><b><%= name %></b></i></font> is not added.
<%
	}
%>
	<hr width="30%" align="left">
<%
}
	addFlag = false;
%>

<a href="main.jsp">Main Page - Flight List</a>


<jsp:include page="footer.jsp"></jsp:include>
		
</body></html>